<script setup lang="ts">
import useInfoStore from "../../store/modules/info";

const infoStore = useInfoStore();

const handler = () => {
  // infoStore.count++;

  // const count = infoStore.count + 1;
  // infoStore.$patch({ count });

  infoStore.incrementCount();
};
</script>

<template>
  <div class="son">
    <h2>子组件1</h2>
    <div>{{ infoStore.count }}</div>
    <div>
      <button @click="handler">修改仓库数据</button>
    </div>
  </div>
</template>

<style scoped>
.son {
  width: 50%;
  min-height: 200px;
  background: cadetblue;
  padding: 1.5rem;
  margin: 0.5rem;
}
</style>
